<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body></body>
  <script>
    //创建一个array对象
    function Person(name, age) {
      this.name = name;
      this.age = age;
      this.getName = function() {
        console.log("helllo " + this.name);
      };
    }

    //    Person.prototype.getAge = function () {
    //        console.log('today is ' + this.age + ' year old');
    //    };

    Object.prototype.getAge = function() {
      console.log("this prototype is object's today is " + this.age + " year old");
    };

    var man = new Person("lilisi", 12);
    man.getName();
    man.getAge();
    console.log(man);

    var woman = new Person("alisi", 22);
    woman.getName();
    woman.getAge();
    console.log(woman.__proto__);
  </script>
</html>
